home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / comm / irc / epic4-mos.lha / share / epic / script / list < prev    next >
Encoding:
Text File  |  2002-09-19  |  481 b   |  20 lines

  1. # showlist <list of items>
  2. #
  3. # Comments:
  4. # This is apparently an intellectual exercise, as this is most certainly
  5. # not the "best" way to do this, by any modern measure.  However, it does
  6. # demonstrate that it is possible to use a counter to iterate through the
  7. # argument list in a useful manner without using recursion of any kind.
  8. #
  9. alias showlist {
  10.     @ sl.cnt = 0
  11.     while (sl.wrd = [$($sl.cnt)])
  12.     {
  13.         echo $sl.wrd
  14.         @sl.cnt++
  15.     }
  16.     ^assign -sl.cnt
  17.     ^assign -sl.wrd
  18. }
  19. #Ian Frechett
  20.